<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>组件的嵌套</title>
		<!-- 引入Vue -->
		<script type="text/javascript" src="../js/vue.js"></script>
	</head>
	<body>
		<!-- 准备好一个容器-->
		<div id="root">
		</div>
	</body>

	<script type="text/javascript">
		Vue.config.productionTip = false //阻止 vue 在启动时生成生产提示。
		//定义student组件
		const student = Vue.extend({
			template:`
				<div>
					<h2>学生姓名：{{name}}</h2>
					<h2>学生年龄：{{age}}</h2>
				</div>
			`,
			data(){
				return {
					name:'尚硅谷',
					age:18
				}
			}
		})
		const hello=Vue.extend({
			template:`<div>
<h1>hello everyone</h1>
</div>`,
			data(){
				return{
				}
			}
		})
		console.log('@',hello)
		console.log('#',student)
		new Vue({
			template: `<div><student></student>
			<hello></hello></div>`,
			el:'#root',
			components:{
				student,
				hello
			}
		})
	</script>
</html>